DoesNotContainAll(TCollection, TElement) Method (ConditionValidator(TCollection), IEnumerable(TElement))

CuttingEdge.Conditions

Checks whether the given value does not contains all of the specified elements. An exception is thrown otherwise. When the elements collection is a null reference or an empty list, the collection is considered to contain all of the specified (even if the value itself is empty). When the given value is empty and the given elements list isn't, the collection is considered to not contain all of the specified elements.

Namespace:  CuttingEdge.Conditions
Assembly:  CuttingEdge.Conditions (in CuttingEdge.Conditions.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function DoesNotContainAll(Of TCollection As IEnumerable(Of TElement), TElement) ( _
	validator As ConditionValidator(Of TCollection), _
	elements As IEnumerable(Of TElement) _
) As ConditionValidator(Of TCollection)
C#
public static ConditionValidator<TCollection> DoesNotContainAll<TCollection, TElement>(
	ConditionValidator<TCollection> validator,
	IEnumerable<TElement> elements
)
where TCollection : IEnumerable<TElement>
Visual C++
public:
generic<typename TCollection, typename TElement>
where TCollection : IEnumerable<TElement>
static ConditionValidator<TCollection>^ DoesNotContainAll(
	ConditionValidator<TCollection>^ validator, 
	IEnumerable<TElement>^ elements
)
JavaScript
JavaScript does not support generic types or methods.

Parameters

validator
Type: CuttingEdge.Conditions..::.ConditionValidator<(Of <(TCollection>)>)
The ConditionValidator<(Of <(T>)>) that holds the value that has to be checked.
elements
Type: System.Collections.Generic..::.IEnumerable<(Of <(TElement>)>)
The list of elements.

Type Parameters

TCollection
The type of the value to check.
TElement
The type that can be considered an element of the TCollection.

Return Value

The specified validator instance.

Exceptions

ExceptionCondition
System..::.ArgumentExceptionThrown when the Value of the specified validator does contain all of the elements of the specified elements list, while the specified validator is created using the Requires extension method.
System..::.ArgumentNullExceptionThrown when the Value of the specified validator is a null reference and the specified elements list is null or empty, while the specified validator is created using the Requires extension method.
CuttingEdge.Conditions..::.PostconditionExceptionThrown when the Value of the specified validator does contain all of the elements of the specified elements list, while the specified validator is created using the Ensures extension method.

See Also